﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsultasLogopedia.Core.Data
{
    public interface IGenericReadOnlyDao<T, ID>
    {
        /// <summary>
        /// Gets an object by its primary key
        /// </summary>
        /// <param name="id">The primary key</param>
        /// <returns>The object instance</returns>
        T GetById(ID id);

        /// <summary>
        /// Returns all the objects backed by this Dao
        /// </summary>
        /// <returns>A List of Objects</returns>
        IList<T> FindAll();

        /// <summary>
        /// Returns the number of objects backed by this Dao
        /// </summary>
        /// <returns></returns>
        int CountAll();

        /// <summary>
        /// Returns all the objects backed by this Dao in a paged way
        /// </summary>
        /// <param name="firstResult">First result to be returned</param>
        /// <param name="maxResults">Last result to be returned</param>
        /// <returns>A List of Objects</returns>
        IList<T> FindAll(int firstResult, int maxResults);

        /// <summary>
        /// Looks for a collection of instances which parameter
        /// Args are like the Value.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="Args"></param>
        /// <returns></returns>
        IList<T> FindByText(String value, String[] Args);

        /// <summary>
        /// Finds by text with a defined filter 
        /// </summary>
        /// <param name="text"></param>
        /// <param name="columns"></param>
        /// <param name="filterColumn"></param>
        /// <param name="filterValue"></param>
        /// <returns></returns>
        IList<T> FindByTextFiltered(String text, String[] columns, String filterColumn, object filterValue);

    }
}
